<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<link rel="stylesheet" href="__HOME__/css/public.css" />
	<link rel="stylesheet" href="__HOME__/css/queren.css" />
	<script type="text/javascript" src="__HOME__/js/jquery.min.js"></script>
	<title>确认订单</title>
	
</head>
<style>
	.del{display: block; width: 15%; height: 26px; margin-left: 70%; border: 1px solid #e9e9e9;
	text-align: center; line-height: 30px; border-radius: 5px; list-style: none; margin-top: 5px;}
	#tu{width: 20px; height: 20px;
		display: block;
		position: absolute; left: 15%; bottom: 14%;}
	#tu img{width: 20px; height: 20px;}
	.defaul{
		/*width: 60px;*/
		position: absolute; left: 15%; bottom: 0; line-height: 30px;}
	.Newaddress{width: 100%; height: 40px; background: #fd4a5f; position: fixed; bottom: 0;text-align: center;}
	.Newaddress a{line-height: 40px; color: #fff; font-size: 14px;}
	button{display: block; width: 15%; height: 26px; margin-left: 70%; border: 1px solid #e9e9e9;
  text-align: center; line-height: 26px; border-radius: 5px; list-style: none; margin-top: 5px;}
  	/*#checkbox{
  		height: 13px;width: 13px;
  		display: block;
		position: absolute; left: 15%; bottom: 14%;
  	}*/
</style>
<body>
	<div class="wrap" style="overflow-x: hidden;">
		<div class="top">
			<div class="top-l">
				<a href="javascript:history.back(-1)">
					<img src="__HOME__/images/top_arrowleft.png" alt="" />
				</a>
			</div>
			<p>地址管理</p>
		</div>
		<!--收货地址-->
		{volist name="sql" id="v"}
			<div class="address">
				<img src="__HOME__/images/TB18VFeJXXXXXXnXpXXoI1ZFVXX-30-40.png" alt="" />
				<div class="link">
					<strong id="username">收货人：{$v.name}</strong>
					<em id="phone">{$v.tel}</em>
				</div>
				<span id="addr">收货人地址:{$v.province} {$v.city} {$v.district} {$v.address}</span>
				<strong class="tu{$v.id}" id="tu">
					<img src="__HOME__/images/icon_radio4.png" alt="">
					<img src="__HOME__/images/icon_radio5.png" alt="" id="image{$v.id}">
				</strong>
				<script type="text/javascript">
					var a = {$v.ismr};
					if(a==1){
						
						$('#image{$v.id}').hide();
					
					}else{
						$('#image{$v.id}').show();
					}
			       	
			       	$("#image{$v.id}").click(function(){

						$('#image{$v.id}').toggle();
						
						var url = "{:url('Address/defaul')}";
						var data = {$v.id};
						$.post(url, {
							'id':data
							},
						 	function(res){
								if(res.code==1){
									layer.msg(res.msg);
									location.reload(true);
								}else{
									layer.msg(res.msg);
								}
							}
						);
					});   
				</script>
				<span class="defaul">设为默认值</span>
				
				<button id="del{$v.id}">删除</button>
				<script type="text/javascript">
					$('#del{$v.id}').click(function(){
						console.log("11111");
								var url = "{:url('Address/del')}";
								var data = {$v.id};
								$.post(url, {
									'id':data
									},
								 	function(data,code){
										if(data.code==1){
											layer.msg(data.msg);
											location.reload(true);
										}else{
											layer.msg(data.msg);
										}
									}
								);
							}
						)
					
				</script>
			</div>
		{/volist}
		<div class="Newaddress"><a href="{:url('Cydia/index')}">+添加新地址</a></div>
	</div>
	<script type="text/javascript" src="__HOME__/layer/layer.js"></script>
</body>
</html>